﻿
$(function () {
    echarts_1();
    // echarts_2();
    echarts_31();
    // echarts_32();
    //echarts_33();
    echarts_4();
    // echarts_5();
    // echarts_6();
})
    function echarts_1() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('echart1'));

        option = {
            //  backgroundColor: '#00265f',
            legend: {
                top: '2%',
                data: ['测算吨耗', '实际吨电'],
                textStyle: {
                    color: '#E1EDFA',
                    fontSize: '12',
                }
            },
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                },
                backgroundColor: "rgba(0, 0, 0, 0.8)",
                borderColor: "rgba(0, 0, 0, 0.8)",
                textStyle: {
                    color: '#E1EDFA',
                }
            },
            grid: {
                left: '3%',
                top: '15%',
                right: '3%',
                bottom: '5%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                data: ['11月', '12月', '1月', '2月', '3月', '4月'],
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(255,255,255,.1)",
                        width: 1,
                        type: "solid"
                    },
                },
                axisTick: {
                    show: false,
                },
                axisLabel: {
                    interval: 0,
                    // rotate:50,
                    show: true,
                    splitNumber: 15,
                    textStyle: {
                        color: "#E1EDFA",
                        fontSize: '12',
                    },
                },
            }],
            yAxis: [{
                type: 'value',
                axisLabel: {
                    //formatter: '{value} %'
                    show: true,
                    textStyle: {
                        color: "#E1EDFA",
                        fontSize: '12',
                    },
                },
                axisTick: {
                    show: false,
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(255,255,255,.1	)",
                        width: 1,
                        type: "solid"
                    },
                },
                splitLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)",
                    }
                }
            }],
            series: [
                {
                    name: '测算吨耗',
                    type: 'bar',
                    data: [200, 300, 300, 1500, 900, 1200, 600],
                    barWidth: '20%', //柱子宽度
                    // barGap: 1, //柱子之间间距
                    itemStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                { offset: 0.02, color: '#0090FF' },
                                { offset: 0.99, color: 'rgba(19, 37, 67, 0.08)' },
                            ]),
                            opacity: 1,
                            barBorderRadius: [2, 2, 0, 0],
                        }
                    }
                },
                {
                    name: '实际吨电',
                    type: 'bar',
                    data: [200, 300, 300, 900, 1500, 1200, 600],
                    barWidth: '20%', //柱子宽度
                    // barGap: 1, //柱子之间间距
                    itemStyle: {
                        // color: ,
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                { offset: 0.01, color: '#CA992F' },
                                { offset: 0.99, color: 'rgba(67, 51, 18, 0.4)' },
                            ]),
                            opacity: 1,
                            barBorderRadius: [2, 2, 0, 0],
                        }
                    }
                }

            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }
    function echarts_2() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('echart2'));

        option = {
            //  backgroundColor: '#00265f',
            tooltip: {
                trigger: 'axis',
                axisPointer: { type: 'shadow' }
            },
            grid: {
                left: '0%',
                top: '10px',
                right: '0%',
                bottom: '4%',
                containLabel: true
            },
            xAxis: [{
                type: 'value',
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(255,255,255,.1)",
                        width: 1,
                        type: "solid"
                    },
                },

                axisTick: {
                    show: false,
                },
                axisLabel: {
                    interval: 0,
                    // rotate:50,
                    show: true,
                    splitNumber: 15,
                    textStyle: {
                        color: "rgba(255,255,255,.6)",
                        fontSize: '12',
                    },
                },
            }],
            yAxis: [{
                data: ['同比', '同比率', '环比', '环比率'],
                type: 'category',
                axisLabel: {
                    //formatter: '{value} %'
                    show: true,
                    textStyle: {
                        color: "rgba(255,255,255,.6)",
                        fontSize: '12',
                    },
                },
                axisTick: {
                    show: false,
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(255,255,255,.1	)",
                        width: 1,
                        type: "solid"
                    },
                },
                splitLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)",
                    }
                }
            }],
            series: [
                {

                    type: 'bar',
                    data: [{ value: 120, itemStyle: { color: '#c23531' } },
                    { value: 200, itemStyle: { color: '#c23531' } },
                    { value: 100, itemStyle: { color: '#61a0a8' } },
                    { value: 80, itemStyle: { color: '#d48265' } }
                    ],
                    barWidth: '35%', //柱子宽度
                    // barGap: 1, //柱子之间间距
                    itemStyle: {
                        normal: {
                            color: '#27d08a',
                            opacity: 1,
                            barBorderRadius: 5,
                        }
                    }
                }

            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }
    function echarts_5() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('echart5'));

        option = {
            //  backgroundColor: '#00265f',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },

            grid: {
                left: '0%',
                top: '10px',
                right: '0%',
                bottom: '2%',
                containLabel: true
            },
            xAxis: [{
                type: 'category',
                data: ['', '', '', '', '', '', '', ''],
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(255,255,255,.1)",
                        width: 1,
                        type: "solid"
                    },
                },

                axisTick: {
                    show: false,
                },
                axisLabel: {
                    interval: 0,
                    // rotate:50,
                    show: true,
                    splitNumber: 15,
                    textStyle: {
                        color: "rgba(255,255,255,.6)",
                        fontSize: '12',
                    },
                },
            }],
            yAxis: [{
                type: 'value',
                axisLabel: {
                    //formatter: '{value} %'
                    show: true,
                    textStyle: {
                        color: "rgba(255,255,255,.6)",
                        fontSize: '12',
                    },
                },
                axisTick: {
                    show: false,
                },
                axisLine: {
                    show: true,
                    lineStyle: {
                        color: "rgba(255,255,255,.1	)",
                        width: 1,
                        type: "solid"
                    },
                },
                splitLine: {
                    lineStyle: {
                        color: "rgba(255,255,255,.1)",
                    }
                }
            }],
            series: [{
                type: 'bar',
                data: [2, 3, 3, 9, 15, 12, 6, 4, 6, 7, 4, 10],
                barWidth: '35%', //柱子宽度
                // barGap: 1, //柱子之间间距
                itemStyle: {
                    normal: {
                        color: '#2f89cf',
                        opacity: 1,
                        barBorderRadius: 5,
                    }
                }
            }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }

    function echarts_4() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('echart4'));

        option = {
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                },
                backgroundColor: "rgba(0, 0, 0, 0.8)",
                borderColor: "rgba(0, 0, 0, 0.8)",
                textStyle: {
                    color: '#E1EDFA',
                }
            },
            legend: {
                top: '2%',
                data: ["监控产量", "申报产量"],
                textStyle: {
                    color: '#E1EDFA',
                    fontSize: '12',
                }
            },
            grid: {
                left: '10',
                top: '38',
                right: '12',
                bottom: '12',
                containLabel: true
            },

            xAxis: [{
                type: 'category',
                boundaryGap: true,
                axisLabel: {
                    textStyle: {
                        color: "#E1EDFA",
                        fontSize: 12,
                    },
                },
                axisLine: {
                    lineStyle: {
                        color: 'rgba(255,255,255,.2)'
                    }

                },

                data: ['25年1月', '25年2月', '25年3月', '25年4月', '25年5月']

            }, {

                axisPointer: { show: false },
                axisLine: { show: false },
                position: 'bottom',
                offset: 20,

            }],

            yAxis: [{
                type: 'value',
                axisTick: { show: false },
                axisLine: {
                    lineStyle: {
                        color: 'rgba(255,255,255,.1)'
                    }
                },
                axisLabel: {
                    textStyle: {
                        color: "#E1EDFA",
                        fontSize: 12,
                    },
                },

                splitLine: {
                    lineStyle: {
                        color: 'rgba(255,255,255,.1)'
                    }
                }
            }],
            series: [
                {
                    name: '监控产量',
                    type: 'line',
                    smooth: true,
                    symbol: 'circle',
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        normal: {
                            color: '#26AFFF',
                            width: 2
                        }
                    },
                    areaStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                offset: 0.1,
                                color: 'rgba(8, 175, 255, 0.65)'
                            }, {
                                offset: 0.8,
                                color: 'rgba(4, 29, 43, 0)'
                            }], false),
                            shadowColor: 'rgba(0, 0, 0, 0.1)',
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: '#26AFFF',
                            borderColor: 'rgba(221, 220, 107, .1)',
                            borderWidth: 1
                        }
                    },
                    data: [25, 23, 35, 46, 39]

                },
                {
                    name: '申报产量',
                    type: 'line',
                    smooth: true,
                    symbol: 'circle',
                    symbolSize: 5,
                    showSymbol: false,
                    lineStyle: {
                        normal: {
                            color: '#FFBE34',
                            width: 2
                        }
                    },
                    areaStyle: {
                        normal: {
                            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                offset: 0.1,
                                color: 'rgba(255, 190, 52, 0.65)'
                            }, {
                                offset: 0.8,
                                color: 'rgba(0,0,0,0)'
                            }], false),
                            shadowColor: 'rgba(0, 0, 0, 0.1)',
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: '#FFBE34',
                            borderColor: 'rgba(221, 220, 107, .1)',
                            borderWidth: 12
                        }
                    },
                    data: [15, 23, 15, 26, 16]

                },
            ]

        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }
    function echarts_6() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('echart6'));

        var dataStyle = {
            normal: {
                label: {
                    show: false
                },
                labelLine: {
                    show: false
                },
                //shadowBlur: 40,
                //shadowColor: 'rgba(40, 40, 40, 1)',
            }
        };
        var placeHolderStyle = {
            normal: {
                color: 'rgba(255,255,255,.05)',
                label: { show: false, },
                labelLine: { show: false }
            },
            emphasis: {
                color: 'rgba(0,0,0,0)'
            }
        };
        option = {
            color: ['#0f63d6', '#0f78d6', '#0f8cd6', '#0fa0d6', '#0fb4d6'],
            tooltip: {
                show: true,
                formatter: "{a} : {c} "
            },
            legend: {
                itemWidth: 10,
                itemHeight: 10,
                itemGap: 12,
                bottom: '3%',

                data: ['浙江', '上海', '广东', '北京', '深圳'],
                textStyle: {
                    color: 'rgba(255,255,255,.6)',
                }
            },

            series: [
                {
                    name: '浙江',
                    type: 'pie',
                    clockWise: false,
                    center: ['50%', '42%'],
                    radius: ['59%', '70%'],
                    itemStyle: dataStyle,
                    hoverAnimation: false,
                    data: [{
                        value: 80,
                        name: '01'
                    }, {
                        value: 20,
                        name: 'invisible',
                        tooltip: { show: false },
                        itemStyle: placeHolderStyle
                    }]
                },
                {
                    name: '上海',
                    type: 'pie',
                    clockWise: false,
                    center: ['50%', '42%'],
                    radius: ['49%', '60%'],
                    itemStyle: dataStyle,
                    hoverAnimation: false,
                    data: [{
                        value: 70,
                        name: '02'
                    }, {
                        value: 30,
                        name: 'invisible',
                        tooltip: { show: false },
                        itemStyle: placeHolderStyle
                    }]
                },
                {
                    name: '广东',
                    type: 'pie',
                    clockWise: false,
                    hoverAnimation: false,
                    center: ['50%', '42%'],
                    radius: ['39%', '50%'],
                    itemStyle: dataStyle,
                    data: [{
                        value: 65,
                        name: '03'
                    }, {
                        value: 35,
                        name: 'invisible',
                        tooltip: { show: false },
                        itemStyle: placeHolderStyle
                    }]
                },
                {
                    name: '北京',
                    type: 'pie',
                    clockWise: false,
                    hoverAnimation: false,
                    center: ['50%', '42%'],
                    radius: ['29%', '40%'],
                    itemStyle: dataStyle,
                    data: [{
                        value: 60,
                        name: '04'
                    }, {
                        value: 40,
                        name: 'invisible',
                        tooltip: { show: false },
                        itemStyle: placeHolderStyle
                    }]
                },
                {
                    name: '深圳',
                    type: 'pie',
                    clockWise: false,
                    hoverAnimation: false,
                    center: ['50%', '42%'],
                    radius: ['20%', '30%'],
                    itemStyle: dataStyle,
                    data: [{
                        value: 50,
                        name: '05'
                    }, {
                        value: 50,
                        name: 'invisible',
                        tooltip: { show: false },
                        itemStyle: placeHolderStyle
                    }]
                },]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }
    function echarts_31(deptId) {
    	var createTime = $("#createTimeInput").val();
    	let arr = createTime.split("至");
    	var map = {
        	deptId:deptId,
    		industry:$("#industry").val(),
    		timeStart:arr[0].replace(/\s+/g, ""),
    		timeEnd:arr[1].replace(/\s+/g, ""),
    	};
    	var data;
    	CoreUtil.sendPost("/visual/main/taxIncrease",map,function (res) {
    		if(res.code == 0){
      	    	console.log(res.data);
      	    	data = res.data;
      	    	$("#taxSum").html(data[4] + "<span>万元</span>");
      	    	
      	   // 基于准备好的dom，初始化echarts实例
      	        var myChart = echarts.init(document.getElementById('fb1'));
      	        var placeHolderStyle = {
      	            borderRadius: 10,
      	            normal: {
      	                color: 'rgba(255,255,255,.05)',
      	                label: { show: false, },
      	                labelLine: { show: false }
      	            },
      	            emphasis: {
      	                color: 'rgba(0,0,0,0)'
      	            }
      	        };
      	        option = {
      	            color: ['#0c60ff', '#ff4808'],
      	            tooltip: {
      	                show: true,
      	                formatter: "{a} : {c} 元",
      	                axisPointer: {
      	                    type: 'shadow'
      	                },
      	                backgroundColor: "rgba(0, 0, 0, 0.8)",
      	                borderColor: "rgba(0, 0, 0, 0.8)",
      	                textStyle: {
      	                    color: '#E1EDFA',
      	                }
      	            },
      	            legend: {
      	                itemWidth: 10,
      	                itemHeight: 10,
      	                itemGap: 12,
      	                bottom: '8%',
      	                data: ['同比值', '同环值'],
      	                textStyle: { color: 'rgba(255,255,255,.6)', }
      	            },

      	            series: [
      	                {
      	                    name: '同比值',
      	                    type: 'pie',
      	                    clockWise: false,
      	                    center: ['50%', '42%'],
      	                    radius: ['59%', '70%'],
      	                    label: {
      	                        show: false
      	                    },
      	                    itemStyle: { borderRadius: 10, },
      	                    tooltip: {

      	                    },
      	                    hoverAnimation: false,
      	                    data: [{
      	                        value: data[0],
      	                        name: '01',
      	                        // itemStyle: {
      	                        //     borderRadius: 10 // 圆角半径
      	                        // },
      	                    }, {
      	                        value: data[0],
      	                        name: 'invisible',
      	                        tooltip: { show: false },
      	                        itemStyle: placeHolderStyle
      	                    }]
      	                },
      	                {
      	                    name: '同环值',
      	                    type: 'pie',
      	                    clockWise: false,
      	                    center: ['50%', '42%'],
      	                    radius: ['49%', '60%'],
      	                    itemStyle: { borderRadius: 10 },
      	                    label: {
      	                        show: false
      	                    },
      	                    hoverAnimation: false,
      	                    data: [{
      	                        value: data[2],
      	                        name: '02'
      	                    }, {
      	                        value: data[2],
      	                        name: 'invisible',
      	                        tooltip: { show: false },
      	                        itemStyle: placeHolderStyle
      	                    }]
      	                },

      	            ]
      	        };

      	        // 使用刚指定的配置项和数据显示图表。
      	        myChart.setOption(option);
      	        window.addEventListener("resize", function () {
      	            myChart.resize();
      	        });
      	        

      	        // 基于准备好的dom，初始化echarts实例
      	        var myChart1 = echarts.init(document.getElementById('fb2'));
      	        var placeHolderStyle = {
      	            normal: {
      	                color: 'rgba(255,255,255,.05)',
      	                label: { show: false, },
      	                labelLine: { show: false }
      	            },
      	            emphasis: {
      	                color: 'rgba(0,0,0,0)'
      	            }
      	        };
      	        option = {
      	            color: ['#0addce', '#ff8d00'],
      	            tooltip: {
      	                show: true,
      	                formatter: "{a} : {c} %",
      	                axisPointer: {
      	                    type: 'shadow'
      	                },
      	                backgroundColor: "rgba(0, 0, 0, 0.8)",
      	                borderColor: "rgba(0, 0, 0, 0.8)",
      	                textStyle: {
      	                    color: '#E1EDFA',
      	                }
      	            },
      	            legend: {
      	                itemWidth: 10,
      	                itemHeight: 10,
      	                itemGap: 12,
      	                bottom: '8%',
      	                data: ['同比率', '同环率'],
      	                textStyle: { color: 'rgba(255,255,255,.6)', }
      	            },

      	            series: [
      	                {
      	                    name: '同比率',
      	                    type: 'pie',
      	                    clockWise: false,
      	                    center: ['50%', '42%'],
      	                    radius: ['59%', '70%'],
      	                    itemStyle: { borderRadius: 10 },
      	                    label: {
      	                        show: false
      	                    },

      	                    hoverAnimation: false,
      	                    data: [{
      	                        value: data[1],
      	                        name: '01'
      	                    }, {
      	                        value: data[1],
      	                        name: 'invisible',
      	                        tooltip: { show: false },
      	                        itemStyle: placeHolderStyle
      	                    }]
      	                },
      	                {
      	                    name: '同环率',
      	                    type: 'pie',
      	                    clockWise: false,
      	                    center: ['50%', '42%'],
      	                    radius: ['49%', '60%'],
      	                    itemStyle: { borderRadius: 10 },
      	                    label: {
      	                        show: false
      	                    },
      	                    hoverAnimation: false,
      	                    data: [{
      	                        value: data[3],
      	                        name: '02'
      	                    }, {
      	                        value: data[3],
      	                        name: 'invisible',
      	                        tooltip: { show: false },
      	                        itemStyle: placeHolderStyle
      	                    }]
      	                },

      	            ]
      	        };

      	        // 使用刚指定的配置项和数据显示图表。
      	        myChart1.setOption(option);
      	        window.addEventListener("resize", function () {
      	            myChart.resize();
      	        });
      	    	
      	    	
      	    }else{
      	    	console.log("taxIncrease" + res.msg);
      	    }
    	})
        
    }
    /*function echarts_32() {
    }*/
    function echarts_33() {
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('fb3'));
        option = {
            title: [{
                text: '兴趣分布',
                left: 'center',
                textStyle: {
                    color: '#fff',
                    fontSize: '16'
                }

            }],
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b}: {c} ({d}%)",
                position: function (p) {   //其中p为当前鼠标的位置
                    return [p[0] + 10, p[1] - 10];
                }
            },
            legend: {
                top: '70%',
                itemWidth: 10,
                itemHeight: 10,
                data: ['汽车', '旅游', '财经', '教育', '软件', '其他'],
                textStyle: {
                    color: 'rgba(255,255,255,.5)',
                    fontSize: '12',
                }
            },
            series: [
                {
                    name: '兴趣分布',
                    type: 'pie',
                    center: ['50%', '42%'],
                    radius: ['40%', '60%'],
                    color: ['#065aab', '#066eab', '#0682ab', '#0696ab', '#06a0ab', '#06b4ab', '#06c8ab', '#06dcab', '#06f0ab'],
                    label: { show: false },
                    labelLine: { show: false },
                    data: [
                        { value: 2, name: '汽车' },
                        { value: 3, name: '旅游' },
                        { value: 1, name: '财经' },
                        { value: 4, name: '教育' },
                        { value: 8, name: '软件' },
                        { value: 1, name: '其他' },
                    ]
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
    }






